//
//  CZNetWorkTool.swift
//  wuJunQianWeiBo
//
//  Created by apple on 15/12/21.
//  Copyright © 2015年 wujunqian. All rights reserved.
//

import UIKit
import AFNetworking

class CZNetWorkTool: AFHTTPSessionManager {
    //单例,调用默认构造方法
    static let shareInstance: CZNetWorkTool =
    {
        //App Key：171377708
        //App Secret：b7e9dded1c2e8c89416af17858830a5f
        //https://api.weibo.com/oauth2/authorize
        //https://api.weibo.com/oauth2/access_token
       let baseURL = NSURL(string: "https://api.weibo.com/")
       let tool = CZNetWorkTool(baseURL: baseURL)
        return tool
    }()
    
    //MARK: - 授权相关
    //
    private let client_id = "171377708"
    private let redirect_uri = "http://www.baidu.com/"
    //拼接登录界面的URL地址
    func oAuthURL() -> NSURL
    {
        let urlString = "https://api.weibo.com/oauth2/authorize?client_id=\(client_id)&redirect_uri=\(redirect_uri)"
        return NSURL(string: urlString)!
    }
}
